<template>
  <div class="popup flex-center flex-align-items-center">
    <div class="main">
      <div class="main-header">
        <p>创意脚本</p>
        <i class="iconfont icon-guanbi" @click="close"></i>
      </div>
      <div class="detail">
        <div class="detail-header flex-between">
          <div class="detail-header-left">
            <div>
              <p class="font-16-B">
                脚本名称：{{ info.name }}
              </p>
            </div>
            <div class="flex-between">
              <p class="font-16-B">
                脚本分类：{{ info.name }}
              </p>
              <p class="font-16-B">
                脚本编号：{{ info.name }}
              </p>
            </div>
          </div>
          <p class="detail-header-right pointer font-14">{{ info.collect ? '取消收藏' : '收藏' }}</p>
        </div>
        <div class="detail-main">
          <div v-for="(item, index) in info.list" :key="index" class="item">
            <div class="flex">
              <div class="item-desc flex" style="width: 50%;">
                <span class="font-14">分镜：1：</span>
                <p class="font-14">{{ item.name }}</p>
              </div>
              <div class="item-desc flex" style="width: 50%;">
                <span class="font-14">建议时长：</span>
                <p class="font-14">{{ item.time }}秒</p>
              </div>
            </div>
            <div class="item-desc flex">
              <span class="font-14">情节概要：</span>
              <p class="font-14">{{ item.desc }}</p>
            </div>
            <div class="item-desc flex">
              <span class="font-14">要点：</span>
              <p class="font-14">{{ item.desc }}</p>
            </div>
          </div>
        </div>
        <div class="detail-footer flex">
          <p class="font-14 pointer">下载</p>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup>
import { defineProps, defineEmits, ref } from 'vue';
const props = defineProps(['id']);
const emit = defineEmits(['close']);

const info = ref({
  name: 'xxx',
  list: [
    {
      name: 'xxx',
      time: 10,
      desc: 'xxxxxxxxxxxxxxxx'
    }
  ]
});

const close = () => {
  emit('close', null);
}
</script>

<style lang="less" scoped>
.main {
  position: relative;
  width: 646px;
  border-radius: 10px;
  background: #fff;
}

.detail {
  padding: 16px 24px;

  .detail-header {
    .detail-header-left {
      width: 420px;

      div {
        margin-bottom: 24px;

        p {
          color: #323233;
        }
      }
    }

    .detail-header-right {
      width: 72px;
      height: 32px;
      border-radius: 2px;
      border: 1px solid @main-color;
      color: @main-color;
      text-align: center;
      line-height: 30px;
    }
  }

  .detail-main {
    height: 317px;
    padding: 20px;
    background: #f6f6f6;
    border: 1px solid #dcdee0;
    border-radius: 4px;
    overflow-y: auto;
    margin-bottom: 24px;

    .item {
      margin-bottom: 24px;
      position: relative;

      &::after {
        content: "";
        height: 1px;
        width: 100%;
        position: absolute;
        bottom: 0;
        background: linear-gradient(90deg, #b1b1b1, #b1b1b1 10px, transparent 0, transparent);
        background-size: 20px 100%;
      }

      .item-desc {
        padding-bottom: 24px;

        span {
          width: 70px;
          margin-right: 8px;
          color: #323233;
        }

        p {
          flex: 1;
          color: #646566;
        }
      }
    }
  }

  .detail-footer {
    justify-content: end;

    p {
      width: 68px;
      height: 32px;
      background: @main-color;
      color: #fff;
      text-align: center;
      line-height: 32px;
    }
  }
}
</style>
